package com.lagou.rpc.consumer.client.lb;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author xingyi
 */
public class RoundRobin extends BaseLoadBalanceStrategy {
    private AtomicInteger index = new AtomicInteger(-1);

    @Override
    public int pickClientIndex() {
        return Math.abs(index.incrementAndGet() % clientSize);
    }
}
